/*
 * @Author: Aro
 * @Date: 2024-01-29 13:27:11
 */
// 手势相关处理

import 'package:flutter/material.dart';

class GestureKit extends StatelessWidget {
  const GestureKit({
    super.key,
    required this.child,
    this.onTap,
    this.backgroundColor = Colors.transparent,
    this.borderRadius = BorderRadius.zero,
    this.type,
  });

  final Widget? child;
  final GestureTapCallback? onTap;
  final Color? backgroundColor;
  final BorderRadiusGeometry borderRadius;
  final String? type;

  Widget inkWellGesture() {
    return ClipRRect(
      borderRadius: borderRadius,
      child: Material(
        color: backgroundColor,
        child: InkWell(
          onTap: onTap,
          child: child,
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    // TODO 扩展多种类型的交互样式 inkwell：水波纹 common：
    switch (type) {
      // case 'inkwell':
      //   return inkWellGesture();
      default:
        return inkWellGesture();
    }
  }
}
